'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const id = event.id
	const table = event.table
	const db=uniCloud.database();
	//删除指定的
	let res = await db.collection(table).doc(id).remove();
	if(res){
		return {
			code:200,
			msg:"删除成功"
		}
	}else{
		return {
			code:500,
			msg:"删除失败"
		}
	}
	//返回数据给客户端
	return event
};
